/*
 * Copyright (C) 2013 Buptcoder
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.buptcoder.wifimap.wifiinfo;

import org.json.JSONException;
import org.json.JSONObject;

import com.buptcoder.wifimap.Utils.Constants;

public class WifiAccessPointInfo {
    private String ssid;
    private double longitude;
    private double lantitude;
    private int type;
    private long updateDate;

    public String getSSID() {
        return ssid;
    }

    public void setSSID(String ssid) {
        this.ssid = ssid;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getLantitude() {
        return lantitude;
    }

    public void setLantitude(double lantitude) {
        this.lantitude = lantitude;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public long getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(long updateDate) {
        this.updateDate = updateDate;
    }

    public JSONObject toJSON() {
        JSONObject json = new JSONObject();
        try {
            json.put(Constants.APINFO_SSID_KEY, getSSID());
            json.put(Constants.APINFO_LAT_KEY, getLantitude());
            json.put(Constants.APINFO_LON_KEY, getLongitude());
            json.put(Constants.APINFO_TYPE_KEY, getType());
            json.put(Constants.APINFO_UPDATE_KEY, getUpdateDate());
        } catch (JSONException e) {
            json = null;
            e.printStackTrace();
        }
        return json;
    }
}
